public class Som{
  int liga=1;
  Sample s1,s2,s3, s4;
  
  
  Som(){
    s1 = new Sample("sons//rebate1.aif");
    s2 = new Sample("sons//rebate2.aif");
    s3= new Sample("sons//powerBall.aiff");
    s4= new Sample("sons//logo.aiff");
    
  }//construtor()
  
  void play(int s){
      if(s==1)
        toca(s1);
      if(s==2)
        toca(s2);
      if(s==3)
        toca(s3);
      if(s==4)
        toca(s4);
  }//play()
  
  
  void toca(Sample s){
    if(!s.isPlaying() && liga==1)
      s.play();
  }
  
  
  
  void setPan(Sample s, Ball bola){
    float pan = -1f + bola.x/(width/2f);
    s.setPan(pan*1.2,0);
    s.setPan(pan*1.2,1);
  }



  
}//fecha classe
